home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18405 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: news.th-darmstadt.de!news
  2. From: enno@inferenzsysteme.informatik.th-darmstadt.de (Enno Sandner)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Derived constructors
  5. Date: 20 Apr 1996 10:21:46 +0200
  6. Organization: Fachbereich Informatik, TH Darmstadt
  7. Sender: enno@kitz.inferenzsysteme.informatik.th-darmstadt.de
  8. Message-ID: <lt7mvbmhk5.fsf@kitz.inferenzsysteme.informatik.th-darmstadt.de>
  9. References: <4l8g4t$4si@mn5.swip.net>
  10. NNTP-Posting-Host: kitz.intellektik.informatik.th-darmstadt.de
  11. In-reply-to: info@koncita.se's message of Fri, 19 Apr 1996 16:47:03 GMT
  12. X-Newsreader: Gnus v5.1
  13.  
  14. In article <4l8g4t$4si@mn5.swip.net> info@koncita.se (Michael Thunberg) writes:
  15.  
  16.    When you derive a class, is it possible to use the parents constructor
  17.    instead of making a new one?
  18.  
  19.    E.g:
  20.  
  21.    class CTest : public CDialog
  22.    {
  23.     ...
  24.    }
  25.  
  26.    class CTemp : public CTest
  27.    {
  28.     ...
  29.    }
  30.  
  31.    and then initialize CTemp using the CTest somehow....
  32.  
  33. Of course -- just state the base-class in the mem-initializer list:
  34.  
  35.                 CTemp() : CTest(<arguments>) { ... }
  36.  
  37.         Enno
  38.